/*
 * MainPanel.fx
 *
 * Created on Nov 20, 2009, 12:46:06 PM
 */

package org.osgifx.ui;
import javafx.scene.CustomNode;
import javafx.scene.Node;
import javafx.scene.shape.Rectangle;
import javafx.scene.paint.Color;
import javafx.scene.Group;

/**
 * @author johan
 */

public class MainPanel extends CustomNode {

  public-init var width;
  public-init var height;

  def margin = 20;

  var background: Rectangle = Rectangle {
    x: margin/2, y: margin/2
    width: width-margin, height: height-margin
    fill: Color.LAVENDER;
    stroke: Color.DARKSLATEBLUE;
    arcWidth:20;
    arcHeight:20;
  }

  public var active: Node;

  var activeGroup: Group = Group {
    translateX:15;
    translateY:15;
    content: bind active;
  }

  override protected function create () : Node {
    Group {
      content: [background, activeGroup]
    }

  }


}
